import { createSlice } from "@reduxjs/toolkit";
import { ThemeState } from "../interface";

const themeState: ThemeState = {
	themeConfig: {
		// 是否暗黑模式
		isDark: false
	}
};

export const themeSlice = createSlice({
	name: "theme",
	initialState: themeState,
	reducers: {
		setThemeConfig(state, action) {
			state.themeConfig = { ...action.payload };
		}
	}
});


export const { setThemeConfig } = themeSlice.actions;
export default themeSlice.reducer;
